import request from '@/utils/request';
import { AxiosPromise } from 'axios';
import { AllotEnterOrderVO, AllotEnterOrderForm, AllotEnterOrderQuery } from '@/api/datacheck/jst/allotEnterOrder/types';

/**
 * 查询聚水潭-调拨入单列表
 * @param query
 * @returns {*}
 */

export const listAllotEnterOrder = (query?: AllotEnterOrderQuery): AxiosPromise<AllotEnterOrderVO[]> => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder/list',
    method: 'get',
    params: query
  });
};

/**
 * 查询聚水潭-调拨入单详细
 * @param id
 */
export const getAllotEnterOrder = (id: string | number): AxiosPromise<AllotEnterOrderVO> => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder/' + id,
    method: 'get'
  });
};

/**
 * 新增聚水潭-调拨入单
 * @param data
 */
export const addAllotEnterOrder = (data: AllotEnterOrderForm) => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder',
    method: 'post',
    data: data
  });
};

/**
 * 修改聚水潭-调拨入单
 * @param data
 */
export const updateAllotEnterOrder = (data: AllotEnterOrderForm) => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder',
    method: 'put',
    data: data
  });
};

/**
 * 删除聚水潭-调拨入单
 * @param id
 */
export const delAllotEnterOrder = (id: string | number | Array<string | number>) => {
  return request({
    url: '/dataCheck/jst/allotEnterOrder/' + id,
    method: 'delete'
  });
};
